#!/bin/bash

set -eux # -x for verbose logging to juju debug-log


##############################
# CONFIG CHANGED
#############################
juju-log "III config-changed"

if [ ! -d "/test" ];
then
  juju-log "III creating the /test mount point."
  mkdir /test
  chown ubuntu:ubuntu /test
  echo "10.0.3.1:/nfsshare /test nfs defaults 0 0" >> /etc/fstab
  juju-log "III Mounting /test"
  mount /test
fi
